using CodePlex.DnD4eCampaignManager.DnD4e;
using CodePlex.DnD4eCampaignManager.DnD4e.Interfaces;
using StructureMap;

namespace CodePlex.DnD4eCampaignManager
{
    public static class DnD4eFactory
    {
        public static T GetInstance<T>()
        {
            return ObjectFactory.GetInstance<T>();
        }

        public static void Initialize()
        {
            ObjectFactory.Configure(x =>
                                        {
                                            x.ForRequestedType<IAbilities>().TheDefault.Is.OfConcreteType<Abilities>();
                                            x.ForRequestedType<IDefenses>().TheDefault.Is.OfConcreteType<Defenses>();
                                            x.ForRequestedType<IHealingSurges>().TheDefault.Is.OfConcreteType<HealingSurges>();
                                            x.ForRequestedType<IHitPoints>().TheDefault.Is.OfConcreteType<HitPoints>();
                                            x.ForRequestedType<IMonster>().TheDefault.Is.OfConcreteType<Monster>();
                                            x.ForRequestedType<IMovement>().TheDefault.Is.OfConcreteType<Movement>();
                                            x.ForRequestedType<IPlayerCharacter>().TheDefault.Is.OfConcreteType<PlayerCharacter>();
                                            x.ForRequestedType<IPowers>().TheDefault.Is.OfConcreteType<Powers>();
                                            x.ForRequestedType<ISenses>().TheDefault.Is.OfConcreteType<Senses>();
                                        });
        }
    }
}